package com.aizhixin.lab.project.course.repository;

import com.aizhixin.lab.project.course.entity.ProjectClassStu;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Collection;
import java.util.List;

public interface ProjectClassStuRepository extends JpaRepository<ProjectClassStu,String> {
    Integer countByProjectIdAndStuIdInAndDeleteFlag(String projectId, List<Long> stuIds,Integer deleteFlag);
    List<ProjectClassStu> findByProjectClassIdAndDeleteFlag(String projectClassId , Integer deleteFlag);
    Integer countByProjectClassIdAndDeleteFlagAndGroupIdIsNull(String projectClassId , Integer deleteFlag);
    Integer countByProjectClassIdAndDeleteFlag(String projectClassId , Integer deleteFlag);
    Integer countByProjectIdAndDeleteFlag(String project,Integer deleteFlag);
    Integer countByProjectIdAndDeleteFlagAndProjectClassIdIn(String project,Integer deleteFlag,List<String> classId);
    Integer countByGroupIdAndDeleteFlag(String groupId,Integer deleteFlag);
    List<ProjectClassStu> findAllByProjectIdAndDeleteFlagAndProjectClassIdIn(String projectId, Integer deleteFlag,List<Long> classId);
    List<ProjectClassStu> findAllByDeleteFlagAndProjectClassIdIn(Integer deleteFlag,List<String> classId);
    List<ProjectClassStu> findAllByProjectIdAndDeleteFlagAndProjectClassIdInAndGroupIdIsNull(String projectId, Integer deleteFlag,List<String> classId);
    List<ProjectClassStu> findAllByProjectIdAndDeleteFlagAndProjectClassIdAndGroupIdIsNull(String projectId, Integer deleteFlag,String classId);
    List<ProjectClassStu> findByStuIdAndDeleteFlag(Long stuId,Integer deleteFlag);
    Integer countByProjectIdAndGroupIdAndDeleteFlag(String projectId,String groupId,Integer deleteFlag);
    List<ProjectClassStu> findByGroupIdAndDeleteFlag(String groupId,Integer deleteFlag);
    List<ProjectClassStu> findByGroupIdAndDeleteFlagAndProjectId(String groupId,Integer deleteFlag,String projectId);
    List<ProjectClassStu> findByProjectIdAndGroupIdAndDeleteFlag(String projectId,String groupId,Integer deleteFlag);
    List<ProjectClassStu> findByProjectIdAndDeleteFlagOrderByGroupId(String projectId,Integer deleteFlag);
    ProjectClassStu findByProjectIdAndStuIdAndDeleteFlag(String projectId,Long stuId,Integer deleteFlag);

    ProjectClassStu findByProjectIdAndStuIdAndGroupIdAndDeleteFlag(String projectId,Long stuId,String groupId,Integer deleteFlag);

    ProjectClassStu findByProjectIdAndRoleAndGroupIdAndDeleteFlag(String projectId,String role,String groupId,Integer deleteFlag);
}
